var fields = {
	filedsList:'select * , (select count(id) from my_zqfootballfielddetail as b where b.fieldId = a.id ) as c from my_zqfootballfields as a',
	fieldDetail:'select * from my_zqfootballfields where id=?',
	fields:'select * from my_zqfootballfielddetail where fieldId=?',
	fieldRules:'select * from my_zqpricerules c inner join my_zqrentaltimeranges b where c.rule_time_range=b.Id order by c.sort',
	fieldOrders:'select id,rangeId,fieldId,rental_date,order_date from my_zqpredetermineorders where recycle=0 and (order_status = 1 or TIMESTAMPDIFF(minute,order_date,now()) <= 15) and TO_DAYS(rental_date)=TO_DAYS(?)',
	fieldRanges:'select * from my_zqrentaltimeranges order by sort',
	daysLimit:'select setting_value from my_zqconfig where setting_type=?',
	fieldNums:'select count(id) as count from my_zqfootballfielddetail where fieldId=?',
	fieldOrder:'select a.*,b.name fieldName,c.name groundName from my_zqpredetermineorders a,my_zqfootballfielddetail b,my_zqfootballfields c '+
					'where a.fieldId = b.id and b.fieldId = c.id and recycle=0 and userId=? and order_status=? order by rental_date desc',
	allFieldOrder:'select * from my_zqpredetermineorders where recycle=0 and userId=?',
	createOrder:'insert into my_zqpredetermineorders (order_no,fieldId,order_date,rental_date,amount,order_status,userId,username,user_tel,time_start,time_end,pay_type,invoice_title,invoice_item,rangeId) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
	paySuccess:'update my_zqpredetermineorders set order_status=1 where order_no=?',
	checkFieldReserved:'select count(*) num from my_zqpredetermineorders where '+
						'(order_status = 1 or TIMESTAMPDIFF(minute,order_date,now()) <= 15) '+
						'and rental_date = ? and fieldId = ? and rangeId = ?',
	deleteOrder:'update my_zqpredetermineorders set recycle=1 where id=? and order_status=0',
};
module.exports = fields; 